package com.jiangjiang.eshop.order.controller;

import com.jiangjiang.eshop.order.dto.ReturnGoodsApplyDTO;
import com.jiangjiang.eshop.order.service.ReturnGoodsApplyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName ReturnGoodsApplyController
 * @Description TODO
 * @Author jhw
 * @Date 2021/9/19 23:01
 * @Version 1.0
 **/
@Slf4j
@RestController
@RequestMapping("/return/goods/apply")
public class ReturnGoodsApplyController {
    @Autowired
    private ReturnGoodsApplyService returnGoodsApplyService;

    /**
     * 根据订单id查询退货申请
     * @param orderInfoId 订单id
     * @return 退货申请
     */
    @GetMapping("/queryByOrderInfoId")
    public ReturnGoodsApplyDTO queryByOrderInfoId(@RequestParam("orderInfoId")Long orderInfoId){
        try {
            return returnGoodsApplyService.queryByOrderInfoId(orderInfoId);
        }catch (Exception e){
            log.warn("ReturnGoodsApplyController queryByOrderInfoId error",e);
        }
        return null;
    }
}
